package day13;

import java.io.*;

//本类是用来测试输出流的演示demo
public class TestOut {
    public static void main(String[] args) throws Exception {
        method();
        method2();
    }

    public static void method() throws Exception {
        OutputStream out = null;
        out = new FileOutputStream("E:\\ready\\2.txt");
        out.write(88);
        out.write(77);
        out.write(65);
        out.close();

    }

    private static void method2() throws Exception {
        //1.创建一个在本方法都生效的局部变量，注意手动初始化
        OutputStream out = null;
        //2.创建高效字节输出流对象
//          out = new BufferedOutputStream(new FileOutputStream(new File("E:\\ready\\2.txt")));
        out = new BufferedOutputStream(new FileOutputStream("E:\\ready\\3.txt", false));
        //3.使用流对象--进行写出操作
        out.write(87);
        out.write(56);
        out.write(66);
        //4.关流
        out.close();
    }

    private static void method3() throws Exception {
        //1.创建一个在本方法都生效的局部变量，注意手动初始化
        InputStream InputStream = null;
        //2.创建高效字节输出流对象
//          out = new BufferedOutputStream(new FileOutputStream(new File("E:\\ready\\2.txt")));
//        in = new BufferedInputStream(FileInputStream));
//        //3.使用流对象--进行写出操作
//        //4.关流
//        out.close();
    }
}
